
#ifndef _RADIX_ENGINE_COMPONENT_H_
#define _RADIX_ENGINE_COMPONENT_H_

#include <Engine/Header.h>

_BeginNamespace(Radix)
/*
=================================================================
== IComponent
=================================================================
*/
class IComponent :public Interface
{
public:
	virtual const String& name() = 0;
	virtual bool init(const StringValueMap& params) = 0;
	virtual void exit() = 0;
};
/*
=================================================================
== Component Module Functions
=================================================================
*/
typedef bool (*InitComponentModuleFunc)(IComponentSystem* componentSystem);
typedef void (*ExitComponentModuleFunc)(IComponentSystem* componentSystem);

static const char* gskInitComponentFuncName = "InitComponentModule";
static const char* gskExitComponentFuncName = "ExitComponentModule";

/*
=================================================================
== IComponentSystem
=================================================================
*/
class IComponentSystem :public Interface
{
public:
	virtual bool loadModule(const String& name) = 0;
	virtual void unloadModule(const String& name) = 0;
	virtual void unloadModules() = 0;

	virtual bool attachComponent(IComponent* component) = 0;
	virtual void detachComponent(IComponent* component) = 0;
	virtual bool containsComponent(const String& name) = 0;
	virtual IComponent* selectComponent(const String& name) = 0;
};

_EndNamespace(Radix)

#endif//_RADIX_ENGINE_COMPONENT_H_
